﻿<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<% String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName();%>
<head>
    <%@ include file="/WEB-INF/jsp/other/head.jsp" %>
    <link rel="stylesheet" href="<%=basePath%>/wxAssets/css/public.css">
    <link rel="stylesheet" href="<%=basePath%>/wxAssets/css/popup.css?t=120183">
    <link rel="stylesheet" href="<%=basePath%>/wxAssets/css/common/header_type_1.css?t=2">
    <link rel="stylesheet" href="<%=basePath%>/wxAssets/css/move_car/move_car.css?t=202004">
    <link rel="stylesheet" href="<%=basePath%>/wxAssets/css/weui.min.css">
</head>
<body>
 <div id="loading"></div>
    <div id="container">
        <div class="header_img">
            <img id="images" src="<%=basePath%>/wxAssets/images/logo.jpg" width="100%" height="100%">
        </div>
        <div id="notice_scroll_div">
            <div class="notice_img">
                <svg class="icon" aria-hidden="true" style="color:#f87946;">
                    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#iconlaba"></use>
                </svg>
            </div>
            <div id="notice_scroll_text">
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*温馨提示* ：输入完车牌号码，点击屏幕任意地方即可进行查询车牌信息!&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            </div>
            <div class="notice_del" onclick="del_notice();">
                <svg class="icon" aria-hidden="true">
                    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#iconshanchu3"></use>
                </svg>
            </div>
        </div>
        <div class="top_div">
            <div class="top_title"></div>
            <div class="top_content">
                <div class="top_content_left">车牌号码</div>
                <div class="car_no_first_button">
                    <div onclick="javascript:$('.popup_car_no').open_popup();" id="car_no_first" class="car_no_t">粤</div>
                </div>
                <input id="car_no_last" name="car_no_last" class="weui-input" type="text" maxlength="7" placeholder="请输入车牌号码" value="" onchange="queryCarNo();">
            </div>
             <div id="top_name" class="top_content top_content_show" style="display: none;">
                <div class="top_content_left top_content_left_show">用户姓名:</div>
                <input id="name" name="name" class="weui-input weui-input_show" type="text" value="">
            </div>
            <div id="top_telphone" class="top_content top_content_show" style="display: none;">
                <div class="top_content_left top_content_left_show">手机号码:</div>
                <input id="telphone" name="telphone" class="weui-input weui-input_show" type="text" value="">
            </div>
            <div class="top_footer">
                <div class="top_footer_left">
                    <a id="tel" style="display: none;">
                        <span class="top_footer_left_c">
                            <div class="top_footer_left_c_d">
                                <svg class="icon icon_color" aria-hidden="true">
                                    <use xlink:href="#iconyijianbohao"></use>
                                </svg>
                            </div>
                            一键拨号
                        </span>
                    </a>
                </div>
                <%--<div class="top_footer_right" onclick="send_wx()">
                    <span class="top_footer_right_c">
                        <div class="top_footer_right_c_d">
                            <svg class="icon icon_color" aria-hidden="true">
                                <use xlink:href="#iconweixin"></use>
                            </svg>
                        </div>
                        微信联系
                    </span>
                </div>--%>
            </div>
        </div>
    </div>
    
    <div class="popup popup_car_no">
		<div class="popup_title_container">
			<a href="javascript:$('.popup_car_no').close_popup();" style="color:#f3a666">关闭</a>
			车辆归属地
		</div>
        <div class="popup_content" id="car_province_list">
            <div class="popup_head">
                <div class="carNo_content is_choose" onclick="choose_carNo(this);">粤</div>
                <div class="carNo_content" onclick="choose_carNo(this);">桂</div>
                <div class="carNo_content" onclick="choose_carNo(this);">琼</div>
                <div class="carNo_content" onclick="choose_carNo(this);">澳</div>
                <div class="carNo_content" onclick="choose_carNo(this);">沪</div>
                <div class="carNo_content" onclick="choose_carNo(this);">豫</div>
            </div>
            <div class="popup_head">
                <div class="carNo_content" onclick="choose_carNo(this);">黑</div>
                <div class="carNo_content" onclick="choose_carNo(this);">宁</div>
                <div class="carNo_content" onclick="choose_carNo(this);">浙</div>
                <div class="carNo_content" onclick="choose_carNo(this);">渝</div>
                <div class="carNo_content" onclick="choose_carNo(this);">云</div>
                <div class="carNo_content" onclick="choose_carNo(this);">赣</div>
            </div>
            <div class="popup_head">
                <div class="carNo_content" onclick="choose_carNo(this);">皖</div>
                <div class="carNo_content" onclick="choose_carNo(this);">辽</div>
                <div class="carNo_content" onclick="choose_carNo(this);">贵</div>
                <div class="carNo_content" onclick="choose_carNo(this);">港</div>
                <div class="carNo_content" onclick="choose_carNo(this);">京</div>
                <div class="carNo_content" onclick="choose_carNo(this);">新</div>
            </div>
            <div class="popup_head">
                <div class="carNo_content" onclick="choose_carNo(this);">川</div>
                <div class="carNo_content" onclick="choose_carNo(this);">青</div>
                <div class="carNo_content" onclick="choose_carNo(this);">藏</div>
                <div class="carNo_content" onclick="choose_carNo(this);">苏</div>
                <div class="carNo_content" onclick="choose_carNo(this);">晋</div>
                <div class="carNo_content" onclick="choose_carNo(this);">吉</div>
            </div>
            <div class="popup_head">
                <div class="carNo_content" onclick="choose_carNo(this);">甘</div>
                <div class="carNo_content" onclick="choose_carNo(this);">冀</div>
                <div class="carNo_content" onclick="choose_carNo(this);">陕</div>
                <div class="carNo_content" onclick="choose_carNo(this);">蒙</div>
                <div class="carNo_content" onclick="choose_carNo(this);">闽</div>
                <div class="carNo_content" onclick="choose_carNo(this);">鄂</div>
            </div>
            <div class="popup_head">
                <div class="carNo_content" onclick="choose_carNo(this);" style="margin-left:15.25%">鲁</div>
                <div class="carNo_content" onclick="choose_carNo(this);" style="margin-left:15.25%">湘</div>
                <div class="carNo_content" onclick="choose_carNo(this);" style="margin-left:15.25%">津</div>
            </div>
        </div>
	</div>
</body>
<script type="text/javascript" src="//at.alicdn.com/t/font_1174287_to505xy9a4r.js"></script>
<script type="text/javascript" src="<%=basePath%>/wxAssets/js/weui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/wxAssets/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/wxAssets/js/publicJSFunction.js?t=5"></script>
<script type="text/javascript" src="<%=basePath%>/wxAssets/js/popup.js?t=20190212"></script>
<script type="text/javascript" src="<%=basePath%>/wxAssets/js/toast_min.js?t=201801311337"></script>
<script type="text/javascript">
	var loading = weui.loading('页面加载中');

	$(function(){
	    loading.hide(function() {
	        $('#loading').addClass('weui-animate-fade-out').on('animationend webkitAnimationEnd', function () {
	            $('#loading').remove();
	        });
	    });
	});

	//查询车辆信息并且返回信息
	function queryCarNo(){
        var car_no_first = $("#car_no_first").html();
        var car_no_last = $("#car_no_last").val();
        var parkCarno = (car_no_first + car_no_last).toUpperCase();;

        if('' == parkCarno || null == parkCarno || undefined == parkCarno){
            $.toast_min('请输入车牌号码！',1000);
            return;
        }
        if(7 > parkCarno.replace(/(^\s+)|(\s+$)/g,"").length){
            $.toast_min('请输入正确的车牌号码!',1000);
            return;
        }

        var xreg=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{5}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
        var creg=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
        if(parkCarno.length == 7){
            if (!creg.test(parkCarno)) {
                $.toast_min('请输入正确的车牌号码!',1000);
                return;
            }
        } else if(parkCarno.length == 8){
            if (!xreg.test(parkCarno)) {
                $.toast_min('请输入正确的车牌号码!',1000);
                return;
            }
        }

        var loading_1 = weui.loading('处理中...');
        $.ajax({
            url: '<%=path%>/wechat/mainParkYard/info',
            data:JSON.stringify({'parkCarno':parkCarno}),
            type:'post',
            contentType: 'application/json',
            success: function (data) {
                var data = data.data;
                loading_1.hide(function() {
                    if(data.appcode == -1){
                        weui.alert(data.appmsg);
                        $('#images').attr('src','<%=basePath%>/wxAssets/images/logo.jpg');
                        $('#name').val('');
                        $('#telphone').val('');
                        $('#tel').attr('href','');
                        $('#top_name').hide();
                        $('#top_telphone').hide();
                        $('#tel').hide();
                        return;
                    }else{
                        weui.alert(data.appmsg,function(){
                            $('#images').attr('src',data.mainWxUser.headImg);
                            $('#name').val(data.mainWxUser.wxName);
                            $('#telphone').val(data.mainWxUser.telphone);
                            $('#tel').attr('href','tel:'+data.mainWxUser.telphone);
                            $('#top_name').show();
                            $('#top_telphone').show();
                            $('#tel').show();
                            return;
                        });
                    }
                })
            }
        })
    }

    var _timer = setInterval("scroll(document.getElementById('notice_scroll_text'))", 40);
    function scroll(obj) {
        /*往左*/
        var tmp = (obj.scrollLeft)++;
        //当滚动条到达右边顶端时
        if (obj.scrollLeft == tmp) {
            obj.innerHTML += obj.innerHTML;
        }
        //当滚动条滚动了初始内容的宽度时滚动条回到最左端
        if (obj.scrollLeft >= obj.firstChild.offsetWidth) {
            obj.scrollLeft = 0;
        }
    }

    //删除公告
    function del_notice(){
        if(_timer){
            window.clearInterval(_timer);
        }
        $('#notice_scroll_div').hide();
    }

    //选择车辆省份信息
    function choose_carNo(el){
        $('#car_no_first').html($(el).html());
        $('.popup_car_no').close_popup();
        $('.is_choose').removeClass('is_choose');
        $(el).addClass('is_choose');
    }
</script>
</html>